class CreateFriendships < ActiveRecord::Migration
  def self.up
    create_table :friendships do |t|
      t.column "user_id",     :integer, :null => false
      t.column "friend_id",   :integer, :null => false
      t.column "created_at",  :datetime
      t.column "accepted_at", :datetime
    end

    foreign_key :friendships, :user_id, :users
    foreign_key :friendships, :friend_id, :users

  end

  def self.down
    drop_table :friendships
  end
end
